

#ifndef RING_MNG_H
#define RING_MNG_H
typedef struct ring_desc{
	uint32_t address;
	uint8_t *buff;
}RING_DESC;
typedef struct ring_mng{
	RING_DESC *ring_list;
	int bsize;
	int readidx;
	int writeidx;
	int usednums;
	int maxnums;
	pthread_mutex_t mutext;
}RING_MNG;

RING_MNG *alloc_ring(int num,int size);
void free_ring(RING_MNG *ring);
int add_entry_to_ring(RING_DESC *entry,RING_MNG *ring);
int get_entry_from_ring(RING_DESC *entry,RING_MNG *ring);
int is_ring_empty(RING_MNG *ring);

#endif
